<?php

/**
 * Video form.
 *
 * @package    sf_sandbox
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormTemplate.php 10377 2008-07-21 07:10:32Z dwhittle $
 */
class profilePhotoForm extends BaseGalleryForm
{
  public function configure()
  {

  	
  	  	  	unset( 
  		$this['created_at'],  
  		$this['updated_at']);
  		
  	     $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
  	  'user_id' =>  new sfWidgetFormInputHidden(),
  	  'group_id' =>  new sfWidgetFormInputHidden( array (), array ('value' => '1')),  
      'photo_path' => new sfWidgetFormInputFile()
    ));  
    
    
        $this->validatorSchema ['photo_path'] = new sfValidatorFile ( array ('required' => true, 
		'path' => sfConfig::get ( 'sf_web_dir' ) . '/uploads/users/gallery', 
		'mime_types' => 'web_images', 'max_size' => 1000000,
        'validated_file_class' => 'sfGalleryValidatedFile' ) ,
        array ('invalid' => 'Invalid file.',
         'required' => 'Select a file to upload.', 
          'max_size' => 'Max size of photo is 1 mb', 
         'mime_types' => 'The file must be of image format.' )
        );
        $this->validatorSchema->setOption ( 'allow_extra_fields', true );
  		$this->widgetSchema->setNameFormat('gallery[%s]');

  }
}
?>